// 高阶组件
import {Navigate} from "react-router-dom"
let IsLogin = (WrapComponent)=>{
    let token = localStorage.getItem("token") || ""
    return (props)=>{
        if (!token) {
            return <Navigate to="/login"></Navigate>
        }
        return <WrapComponent {...props}></WrapComponent>
    }
}
export default IsLogin